import { request } from '@/service/request';

/** 获取供应商管理列表 */
export function fetchGetSupplierList (params?: Api.System.SupplierSearchParams) {
    return request<Api.System.SupplierList>({
        url: '/system/supplier/list',
        method: 'get',
        params
    });
}

/** 新增供应商管理 */
export function fetchCreateSupplier (data: Api.System.SupplierOperateParams) {
    return request<boolean>({
        url: '/system/supplier',
        method: 'post',
        data
    });
}

/** 修改供应商管理 */
export function fetchUpdateSupplier (data: Api.System.SupplierOperateParams) {
    return request<boolean>({
        url: '/system/supplier',
        method: 'put',
        data
    });
}

/** 批量删除供应商管理 */
export function fetchBatchDeleteSupplier (ids: CommonType.IdType[]) {
    return request<boolean>({
        url: `/system/supplier/${ids.join(',')}`,
        method: 'delete'
    });
}
